package Controller;

import java.util.GregorianCalendar;
import DataLayer.DBFacade;
import Domain.Besked;
import Domain.Bruger;
import Domain.Lokation;

public class Controller 
{
	private static Controller control;
	private DBFacade dbf;
	private Bruger bruger;
	
	private Controller() {
		
		dbf = DBFacade.getInstance();
	}
	
	public static Controller Instance() {
		if(control == null)
			control = new Controller();
		
		return control;
	}
	
	public void opretBruger() {
		Bruger bruger = new Bruger("Sperm@spermtrol.dk", "12345678", 1, "Bettina", "Fra Broendbystrand", 1);
		dbf.opretBruger(bruger);
	}
	
	public void opretBesked() {
		GregorianCalendar g = new GregorianCalendar();
		
		bruger = new Bruger("","",1,"","",1);
		bruger.setId(1);
		Besked besked = new Besked("Spermtrold fundet", "Slemt er det. Masser af sae.", bruger.getId(), g.getTimeInMillis());
		dbf.opretBesked(besked);
	}
	
	public void opretLokation() {
		Lokation lokation = new Lokation("Kagelandslokalet", "Kaederen", 2300);
		dbf.opretLokation(lokation);
		
	}
}
